package com.quotes.charts;

import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.data.xy.*;
import com.quotes.datamodell.*;
import com.quotes.dates.TimeRange;
import com.quotes.indicators.*;

public class AtrChart extends LineChart
{
	private static final long serialVersionUID = 1L;
	private AdxIndicator indicator = null;
	
	public AtrChart(Quotes quotes, TimeRange range, int ticks) {
		super(quotes, range);
		this.indicator = new AdxIndicator(quotes, ticks);
		this.createChart(quotes);
	}
	
	protected XYDataset createXyDataset(Quotes product) {
		TimeSeriesCollection data = new TimeSeriesCollection();

    	TimeSeries adx = indicator.getAtr().extract(range);
    	data.addSeries(adx.convertToChartTimeSeries("ATR"));
    	
		return data;
	}
	
//	@Override
//	protected XYPlot manipulatePlot(XYPlot plot) {
//		addVerticalMarker(plot, 25, Color.black);
//		
//		return plot;
//	}
}
